Add additional light shadow support to Toon lighting model#445
Add additional light shadow support to Toon lighting model#445hybridherbst wants to merge 1 commit intoUnityTechnologies:mainfrom
Conversation
|
Not sure if needed. We generally don't have spotlights, I don't see an use for them in this game, and the point lights (torches, the phoenix chick, etc.) don't cast a shadow. As you know, point light shadows only came in more recent URP versions. |
|
I saw that the ShaderGraph shaders defined the ADDITIONAL_LIGHT_SHADOWS keyword so it seems it was used at some point (or someone tried - as it was probably never working so far). Not sure either if it's needed here, but it doesn't hurt either (if additional light shadows are off the code isn't used at all, conditional compilation for the win) – people are gonna look at Open Project as a reference (many people wait for a proper toon shader for URP) so I think a bit more complete feature support is nice to have. |
The current custom lighting implementation didn't support additional light shadows. They are turned off on the UniversalRenderPipelineAsset, but since the existing ShaderGraph implementation did contain the relevant keywords I assume they are supposed to work.
This PR adds support for additional light shadows by calling the right GetAdditionalLight overload that takes shadowCoords. There's probably an edge case missing for lightmapped objects that are supposed to also receive mixed lighting with shadows from additional lights, but I think for now it's nice to have shadows when wanted :)
Before / After:

